import storage from "./storage";
import store from '../store'
import tabBar from './tabbar.js'

export default {
   set(name, value) {
      uni.setStorageSync(name, value);
   },
   get(name) {
      return uni.getStorageSync(name);
   },
   remove(name) {
      uni.removeStorageSync(name);
   },
   clear() {
      uni.clearStorageSync();
   },
   changeList() {
      let userInfo = storage.getJson("userInfo");
      let type = "member";

      if (userInfo != null) {
         switch (userInfo.utype) {
            case "1":
               type = "member";
               break;
            case "2":
               type = "firm";
               break;
            default:
               break;
         }
      }

      store.state.tabarList = tabBar[type];
   },
};
